#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_daylight_clicked()
{
    // 设置窗口背景
//    this->setStyleSheet("background-color: white");
    this->setStyleSheet("background-color: rgb(240,240,240)");

    // 设置输入框背景
    ui->textEdit->setStyleSheet("background-color: white; color: black");

    // 设置两个按钮颜色
    ui->pushButton_daylight->setStyleSheet("background-color: rgb(#FDFDFD); color: black");
    ui->pushButton_moonlight->setStyleSheet("background-color: rgb(#FDFDFD); color: black");
}

void Widget::on_pushButton_moonlight_clicked()
{
    // 设置窗口背景
//    this->setStyleSheet("background-color: white");
    this->setStyleSheet("background-color: black");

    // 设置输入框背景
    ui->textEdit->setStyleSheet("background-color: black; color: white");

    // 设置两个按钮颜色
    ui->pushButton_daylight->setStyleSheet("background-color: black; color: white");
    ui->pushButton_moonlight->setStyleSheet("background-color: black; color: white");
}
